const crypto = require('crypto')

/**
 * @description 加密密码
 * @param {String} password
 * @returns 加密后的密码
 */
function cryptPwd(password) {
  let saltPassword = password + ':' + process.env.salt
  const md5 = crypto.createHash('md5')
  return md5.update(saltPassword).digest('hex')
}

module.exports = cryptPwd
